<template>
  <div class="log-cotent">
    <virtual-list
      style="height: 100%; overflow-y: auto; padding-right: 16px"
      :data-key="'id'"
      :data-sources="items"
      :data-component="itemComponent"
      :keeps="200"
    />
  </div>
</template>
<script>
import virtualList from 'vue-virtual-scroll-list';     //引入
import Item from "./Item";
import Mock from 'mockjs'
let items = [];
for (let i = 0; i < 100000; i++) {
  items.push({id: i, title: Mock.Random.sentence(5,50)})
}
export default {
  name: "list",
  data() {
    return {
      itemComponent: Item,
      items
    }
  },
  components: { "virtual-list": virtualList },          //注册
  created() {
  }
}
</script>

<style scoped>
* {
  box-sizing: border-box;
}
</style>
